#include"Shm.hpp"
#include"fifo.hpp"
#include"Common.hpp"

int main()
{
    Shm shm (pathname,projid,CREATER);
    shm.Attr();

    NamedFifo fifo(PATH,FILENAME);
    FileOper readfile(PATH,FILENAME);
    readfile.OpenForRead();

    char* men = (char*)shm.VirtualAddr();

    while(1)
    {
        if(readfile.Wait())
        {
            printf("%s\n",men);
        }
        else
        {
            break;
        }
    }

    readfile.Close();
    std::cout<<"server end normal!"<<std::endl;

    return 0;

}